grammar XHTML2CSV;

options {
	output=AST;
	ASTLabelType=CommonTree;
}

tokens {
	CELLULE;									// anonymous tokens (usefull to give meaningfull name to AST labels)
	CELLULEG	=  '<td>';
	CELLULED	=  '</td>';						// simple lexemes
}

@members {
												// variables and methods to be included in the java file generated
}
 
/*------------------------------------------------------------------
 * PARSER RULES
 *------------------------------------------------------------------*/

// example

cellule	: CELLULEG CHAINE CELLULED 			  	// rule
		-> ^(CELLULE CHAINE);				  	// tree construction


/*------------------------------------------------------------------
 * LEXER RULES
 *------------------------------------------------------------------*/

WHITESPACE : ( '\t' | ' ' | '\r' | '\n'| '\u000C' )+ {
				$channel = HIDDEN;
			} ;  															// skip white spaces
 
CHAINE	:  (~('\"' | ',' | '\n' | '<' | '>'))+; 							// complex lexemes

